<template>
  <div class="policyDetails">
    <div class="header">
      <!-- 面包屑 -->
      <el-breadcrumb separator=">">
        <el-breadcrumb-item @click="back">政策查询</el-breadcrumb-item>
        <el-breadcrumb-item>正文</el-breadcrumb-item>
      </el-breadcrumb>
      <button class="backBtn" @click="back">返回</button>
    </div>
    <div class="container">
      <div class="title">{{ currentPolicyDetail.title }}</div>
      <div class="subtitle">
        <div>时间：{{ currentPolicyDetail.createTime }}</div>
        <div>来源：{{ currentPolicyDetail.source }}</div>
      </div>
      <el-scrollbar>
        <p class="content" v-html="currentPolicyDetail.info"></p>
      </el-scrollbar>
    </div>
  </div>
</template>

<script setup>
import { defineProps, toRefs } from 'vue'

const props = defineProps({
  setComponent:{
    type: Function,
    required: true
  },
  currentPolicyDetail:{
    type: Object,
    required: true
  }
})

const { currentPolicyDetail } = toRefs(props)

const back = () => {
  props.setComponent('PolifyList')
}
</script>

<style lang="less" scoped>
.policyDetails{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  .header{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .1563rem;
    .el-breadcrumb{
      font-family: 'AlibabaPuHuiTi';
      font-size: .1042rem;
      color: #FFFFFF;
      line-height: .3125rem;
      /deep/.el-breadcrumb__inner{
        --el-text-color-regular: #fff;
      }
    }
    .backBtn{
      width: .4792rem;
      height: .2708rem;
      background: linear-gradient(to bottom, #F3F7FF 0%, #cbdffd 100%);
      outline: none;
      border: none;
      border-radius: .026rem;
      font-size: .1042rem;
      font-family: 'AlibabaPuHuiTi';
    }
  }
  .container{
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    .title{
      align-self: center;
      font-size: .1875rem;
      font-family: 'AlibabaPuHuiTi';
      color: #FFFFFF;
      line-height: .3125rem;
      text-align: center;
    }
    .subtitle{
      align-self: center;
      font-size: .1042rem;
      font-family: 'AlibabaPuHuiTi';
      color: #FFFFFF;
      line-height: .3125rem;
      display: flex;
      &>div:first-child{
        margin-right: .2604rem;
      }
    }
    .el-scrollbar{
      flex: 1;
      .content{
        white-space: pre-wrap;
        font-size: .1042rem;
        font-family: 'AlibabaPuHuiTi';
        color: #FFF;
        line-height: .1875rem;
        :deep(.policyImage){
          width: 1.0313rem;
          height: 1.0313rem;
          float: right;
          margin-bottom: .1042rem;
        }
        :deep([style]){
          font-size: .1042rem!important;
        }
      }
    }
  }
}
</style>